
import java.util.Scanner;

class BIT {

    public static void main(String[] args) {
        int i = 0, j = 0, k = 0, l = 0, v, cont = 0, testes;
        Scanner entrada = new Scanner(System.in);
        do {

            v = entrada.nextInt();
            testes = v;
            if (v >= 50) {
                i = v / 50;
                v %= 50;
            }
            if (v >= 10) {
                j = v / 10;
                v %= 10;
            }
            if (v >= 5) {
                k = v / 5;
                v %= 5;
            }
            if (v >= 1) {
                l = v / 1;
                v %= 1;
            }
            cont++;
            if (testes > 0) {

                System.out.println("Teste " + cont);
                System.out.println(i + " " + j + " " + k + " " + l);
                System.out.println();
                i = 0;
                j = 0;
                k = 0;
                l = 0;
            }

        } while (testes > 0);

    }

}
